<?php
namespace app\h5api\controller;

use think\worker\Server;

class Swoole extends Server
{
	protected $socket = 'http://111.230.171.153:8888';
	static $uidConnections = [];
	public function onMessage($connection, $data)
	{
		if (!in_array($connection,self::$uidConnections)) {
			array_push(self::$uidConnections,$connection);
		}
		foreach (self::$uidConnections as $person) {
			$person->send($data);
		}
	}
}